// 音乐路由创建方式 createRouter
import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/find',
    name: 'find',
    component: () => import('../views/Find.vue'),
    children: [
      {
        path: 'discover',
        name: 'discover',
        component: () => import('../views/Sonvue/Discover.vue')
      },
      {
        path: 'toplist',
        name: 'toplist',
        component: () => import('../views/Sonvue/Toplist.vue')
      },
      {
        path: 'playlist',
        name: 'playlist',
        component: () => import('../views/Sonvue/Playlist.vue')
      },
      {
        path: 'album',
        name: 'album',
        component: () => import('../views/Sonvue/Album.vue')
      }
    ]
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/My.vue')
  }
  ,
  {
    path: '/parent',
    name: 'parent',
    component: () => import('../views/Parent.vue')
  }
]

const router = createRouter({
  // createWebHistory 是路由得模式  路由有两种模式  history 在url上不显示#号
  //createHashWebHistory 是 hash模式 是在url上包含#得
   history: createWebHistory(process.env.BASE_URL),
  //history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
